<?php


abstract class BaseUser extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $type;


	
	protected $first_name;


	
	protected $last_name;


	
	protected $email;


	
	protected $nickname;


	
	protected $notifications;


	
	protected $msn;


	
	protected $yahoo;


	
	protected $icq;


	
	protected $skype;


	
	protected $gtalk;


	
	protected $aim;


	
	protected $twitter;


	
	protected $location;


	
	protected $ventures;


	
	protected $website;


	
	protected $raisedmoney;


	
	protected $ventureraised;


	
	protected $linkedin;


	
	protected $facebook;


	
	protected $avatarurl;


	
	protected $zipcode;


	
	protected $country;


	
	protected $state;


	
	protected $age;


	
	protected $relocation;


	
	protected $yexperience;


	
	protected $canworkas;


	
	protected $resumeurl;


	
	protected $expequity;


	
	protected $readycommitment;


	
	protected $avatar_id;


	
	protected $password_sha1;


	
	protected $salt;


	
	protected $invited;


	
	protected $created_at;


	
	protected $updated_at;

	
	protected $collCompanyShadows;

	
	protected $lastCompanyShadowCriteria = null;

	
	protected $collCompanys;

	
	protected $lastCompanyCriteria = null;

	
	protected $collUser2Permissions;

	
	protected $lastUser2PermissionCriteria = null;

	
	protected $collCompanyCommentss;

	
	protected $lastCompanyCommentsCriteria = null;

	
	protected $collPostss;

	
	protected $lastPostsCriteria = null;

	
	protected $collCommentss;

	
	protected $lastCommentsCriteria = null;

	
	protected $colluser2facebooks;

	
	protected $lastuser2facebookCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getType()
	{

		return $this->type;
	}

	
	public function getFirstName()
	{

		return $this->first_name;
	}

	
	public function getLastName()
	{

		return $this->last_name;
	}

	
	public function getEmail()
	{

		return $this->email;
	}

	
	public function getNickname()
	{

		return $this->nickname;
	}

	
	public function getNotifications()
	{

		return $this->notifications;
	}

	
	public function getMsn()
	{

		return $this->msn;
	}

	
	public function getYahoo()
	{

		return $this->yahoo;
	}

	
	public function getIcq()
	{

		return $this->icq;
	}

	
	public function getSkype()
	{

		return $this->skype;
	}

	
	public function getGtalk()
	{

		return $this->gtalk;
	}

	
	public function getAim()
	{

		return $this->aim;
	}

	
	public function getTwitter()
	{

		return $this->twitter;
	}

	
	public function getLocation()
	{

		return $this->location;
	}

	
	public function getVentures()
	{

		return $this->ventures;
	}

	
	public function getWebsite()
	{

		return $this->website;
	}

	
	public function getRaisedmoney()
	{

		return $this->raisedmoney;
	}

	
	public function getVentureraised()
	{

		return $this->ventureraised;
	}

	
	public function getLinkedin()
	{

		return $this->linkedin;
	}

	
	public function getFacebook()
	{

		return $this->facebook;
	}

	
	public function getAvatarurl()
	{

		return $this->avatarurl;
	}

	
	public function getZipcode()
	{

		return $this->zipcode;
	}

	
	public function getCountry()
	{

		return $this->country;
	}

	
	public function getState()
	{

		return $this->state;
	}

	
	public function getAge()
	{

		return $this->age;
	}

	
	public function getRelocation()
	{

		return $this->relocation;
	}

	
	public function getYexperience()
	{

		return $this->yexperience;
	}

	
	public function getCanworkas()
	{

		return $this->canworkas;
	}

	
	public function getResumeurl()
	{

		return $this->resumeurl;
	}

	
	public function getExpequity()
	{

		return $this->expequity;
	}

	
	public function getReadycommitment()
	{

		return $this->readycommitment;
	}

	
	public function getAvatarId()
	{

		return $this->avatar_id;
	}

	
	public function getPasswordSha1()
	{

		return $this->password_sha1;
	}

	
	public function getSalt()
	{

		return $this->salt;
	}

	
	public function getInvited()
	{

		return $this->invited;
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUpdatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->updated_at === null || $this->updated_at === '') {
			return null;
		} elseif (!is_int($this->updated_at)) {
						$ts = strtotime($this->updated_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
			}
		} else {
			$ts = $this->updated_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = UserPeer::ID;
		}

	} 
	
	public function setType($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->type !== $v) {
			$this->type = $v;
			$this->modifiedColumns[] = UserPeer::TYPE;
		}

	} 
	
	public function setFirstName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->first_name !== $v) {
			$this->first_name = $v;
			$this->modifiedColumns[] = UserPeer::FIRST_NAME;
		}

	} 
	
	public function setLastName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->last_name !== $v) {
			$this->last_name = $v;
			$this->modifiedColumns[] = UserPeer::LAST_NAME;
		}

	} 
	
	public function setEmail($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->email !== $v) {
			$this->email = $v;
			$this->modifiedColumns[] = UserPeer::EMAIL;
		}

	} 
	
	public function setNickname($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->nickname !== $v) {
			$this->nickname = $v;
			$this->modifiedColumns[] = UserPeer::NICKNAME;
		}

	} 
	
	public function setNotifications($v)
	{

		if ($this->notifications !== $v) {
			$this->notifications = $v;
			$this->modifiedColumns[] = UserPeer::NOTIFICATIONS;
		}

	} 
	
	public function setMsn($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->msn !== $v) {
			$this->msn = $v;
			$this->modifiedColumns[] = UserPeer::MSN;
		}

	} 
	
	public function setYahoo($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->yahoo !== $v) {
			$this->yahoo = $v;
			$this->modifiedColumns[] = UserPeer::YAHOO;
		}

	} 
	
	public function setIcq($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->icq !== $v) {
			$this->icq = $v;
			$this->modifiedColumns[] = UserPeer::ICQ;
		}

	} 
	
	public function setSkype($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->skype !== $v) {
			$this->skype = $v;
			$this->modifiedColumns[] = UserPeer::SKYPE;
		}

	} 
	
	public function setGtalk($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->gtalk !== $v) {
			$this->gtalk = $v;
			$this->modifiedColumns[] = UserPeer::GTALK;
		}

	} 
	
	public function setAim($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->aim !== $v) {
			$this->aim = $v;
			$this->modifiedColumns[] = UserPeer::AIM;
		}

	} 
	
	public function setTwitter($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->twitter !== $v) {
			$this->twitter = $v;
			$this->modifiedColumns[] = UserPeer::TWITTER;
		}

	} 
	
	public function setLocation($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->location !== $v) {
			$this->location = $v;
			$this->modifiedColumns[] = UserPeer::LOCATION;
		}

	} 
	
	public function setVentures($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->ventures !== $v) {
			$this->ventures = $v;
			$this->modifiedColumns[] = UserPeer::VENTURES;
		}

	} 
	
	public function setWebsite($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->website !== $v) {
			$this->website = $v;
			$this->modifiedColumns[] = UserPeer::WEBSITE;
		}

	} 
	
	public function setRaisedmoney($v)
	{

		if ($this->raisedmoney !== $v) {
			$this->raisedmoney = $v;
			$this->modifiedColumns[] = UserPeer::RAISEDMONEY;
		}

	} 
	
	public function setVentureraised($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->ventureraised !== $v) {
			$this->ventureraised = $v;
			$this->modifiedColumns[] = UserPeer::VENTURERAISED;
		}

	} 
	
	public function setLinkedin($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->linkedin !== $v) {
			$this->linkedin = $v;
			$this->modifiedColumns[] = UserPeer::LINKEDIN;
		}

	} 
	
	public function setFacebook($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->facebook !== $v) {
			$this->facebook = $v;
			$this->modifiedColumns[] = UserPeer::FACEBOOK;
		}

	} 
	
	public function setAvatarurl($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->avatarurl !== $v) {
			$this->avatarurl = $v;
			$this->modifiedColumns[] = UserPeer::AVATARURL;
		}

	} 
	
	public function setZipcode($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->zipcode !== $v) {
			$this->zipcode = $v;
			$this->modifiedColumns[] = UserPeer::ZIPCODE;
		}

	} 
	
	public function setCountry($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->country !== $v) {
			$this->country = $v;
			$this->modifiedColumns[] = UserPeer::COUNTRY;
		}

	} 
	
	public function setState($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->state !== $v) {
			$this->state = $v;
			$this->modifiedColumns[] = UserPeer::STATE;
		}

	} 
	
	public function setAge($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->age !== $v) {
			$this->age = $v;
			$this->modifiedColumns[] = UserPeer::AGE;
		}

	} 
	
	public function setRelocation($v)
	{

		if ($this->relocation !== $v) {
			$this->relocation = $v;
			$this->modifiedColumns[] = UserPeer::RELOCATION;
		}

	} 
	
	public function setYexperience($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->yexperience !== $v) {
			$this->yexperience = $v;
			$this->modifiedColumns[] = UserPeer::YEXPERIENCE;
		}

	} 
	
	public function setCanworkas($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->canworkas !== $v) {
			$this->canworkas = $v;
			$this->modifiedColumns[] = UserPeer::CANWORKAS;
		}

	} 
	
	public function setResumeurl($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->resumeurl !== $v) {
			$this->resumeurl = $v;
			$this->modifiedColumns[] = UserPeer::RESUMEURL;
		}

	} 
	
	public function setExpequity($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->expequity !== $v) {
			$this->expequity = $v;
			$this->modifiedColumns[] = UserPeer::EXPEQUITY;
		}

	} 
	
	public function setReadycommitment($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->readycommitment !== $v) {
			$this->readycommitment = $v;
			$this->modifiedColumns[] = UserPeer::READYCOMMITMENT;
		}

	} 
	
	public function setAvatarId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->avatar_id !== $v) {
			$this->avatar_id = $v;
			$this->modifiedColumns[] = UserPeer::AVATAR_ID;
		}

	} 
	
	public function setPasswordSha1($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->password_sha1 !== $v) {
			$this->password_sha1 = $v;
			$this->modifiedColumns[] = UserPeer::PASSWORD_SHA1;
		}

	} 
	
	public function setSalt($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->salt !== $v) {
			$this->salt = $v;
			$this->modifiedColumns[] = UserPeer::SALT;
		}

	} 
	
	public function setInvited($v)
	{

		if ($this->invited !== $v) {
			$this->invited = $v;
			$this->modifiedColumns[] = UserPeer::INVITED;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = UserPeer::CREATED_AT;
		}

	} 
	
	public function setUpdatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->updated_at !== $ts) {
			$this->updated_at = $ts;
			$this->modifiedColumns[] = UserPeer::UPDATED_AT;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->type = $rs->getString($startcol + 1);

			$this->first_name = $rs->getString($startcol + 2);

			$this->last_name = $rs->getString($startcol + 3);

			$this->email = $rs->getString($startcol + 4);

			$this->nickname = $rs->getString($startcol + 5);

			$this->notifications = $rs->getBoolean($startcol + 6);

			$this->msn = $rs->getString($startcol + 7);

			$this->yahoo = $rs->getString($startcol + 8);

			$this->icq = $rs->getString($startcol + 9);

			$this->skype = $rs->getString($startcol + 10);

			$this->gtalk = $rs->getString($startcol + 11);

			$this->aim = $rs->getString($startcol + 12);

			$this->twitter = $rs->getString($startcol + 13);

			$this->location = $rs->getString($startcol + 14);

			$this->ventures = $rs->getString($startcol + 15);

			$this->website = $rs->getString($startcol + 16);

			$this->raisedmoney = $rs->getBoolean($startcol + 17);

			$this->ventureraised = $rs->getString($startcol + 18);

			$this->linkedin = $rs->getString($startcol + 19);

			$this->facebook = $rs->getString($startcol + 20);

			$this->avatarurl = $rs->getString($startcol + 21);

			$this->zipcode = $rs->getString($startcol + 22);

			$this->country = $rs->getString($startcol + 23);

			$this->state = $rs->getString($startcol + 24);

			$this->age = $rs->getString($startcol + 25);

			$this->relocation = $rs->getBoolean($startcol + 26);

			$this->yexperience = $rs->getString($startcol + 27);

			$this->canworkas = $rs->getString($startcol + 28);

			$this->resumeurl = $rs->getString($startcol + 29);

			$this->expequity = $rs->getString($startcol + 30);

			$this->readycommitment = $rs->getString($startcol + 31);

			$this->avatar_id = $rs->getInt($startcol + 32);

			$this->password_sha1 = $rs->getString($startcol + 33);

			$this->salt = $rs->getString($startcol + 34);

			$this->invited = $rs->getBoolean($startcol + 35);

			$this->created_at = $rs->getTimestamp($startcol + 36, null);

			$this->updated_at = $rs->getTimestamp($startcol + 37, null);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 38; 
		} catch (Exception $e) {
			throw new PropelException("Error populating User object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(UserPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			UserPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(UserPeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

    if ($this->isModified() && !$this->isColumnModified(UserPeer::UPDATED_AT))
    {
      $this->setUpdatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(UserPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = UserPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += UserPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collCompanyShadows !== null) {
				foreach($this->collCompanyShadows as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCompanys !== null) {
				foreach($this->collCompanys as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUser2Permissions !== null) {
				foreach($this->collUser2Permissions as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCompanyCommentss !== null) {
				foreach($this->collCompanyCommentss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collPostss !== null) {
				foreach($this->collPostss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCommentss !== null) {
				foreach($this->collCommentss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->colluser2facebooks !== null) {
				foreach($this->colluser2facebooks as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = UserPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collCompanyShadows !== null) {
					foreach($this->collCompanyShadows as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCompanys !== null) {
					foreach($this->collCompanys as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUser2Permissions !== null) {
					foreach($this->collUser2Permissions as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCompanyCommentss !== null) {
					foreach($this->collCompanyCommentss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collPostss !== null) {
					foreach($this->collPostss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCommentss !== null) {
					foreach($this->collCommentss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->colluser2facebooks !== null) {
					foreach($this->colluser2facebooks as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = UserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getType();
				break;
			case 2:
				return $this->getFirstName();
				break;
			case 3:
				return $this->getLastName();
				break;
			case 4:
				return $this->getEmail();
				break;
			case 5:
				return $this->getNickname();
				break;
			case 6:
				return $this->getNotifications();
				break;
			case 7:
				return $this->getMsn();
				break;
			case 8:
				return $this->getYahoo();
				break;
			case 9:
				return $this->getIcq();
				break;
			case 10:
				return $this->getSkype();
				break;
			case 11:
				return $this->getGtalk();
				break;
			case 12:
				return $this->getAim();
				break;
			case 13:
				return $this->getTwitter();
				break;
			case 14:
				return $this->getLocation();
				break;
			case 15:
				return $this->getVentures();
				break;
			case 16:
				return $this->getWebsite();
				break;
			case 17:
				return $this->getRaisedmoney();
				break;
			case 18:
				return $this->getVentureraised();
				break;
			case 19:
				return $this->getLinkedin();
				break;
			case 20:
				return $this->getFacebook();
				break;
			case 21:
				return $this->getAvatarurl();
				break;
			case 22:
				return $this->getZipcode();
				break;
			case 23:
				return $this->getCountry();
				break;
			case 24:
				return $this->getState();
				break;
			case 25:
				return $this->getAge();
				break;
			case 26:
				return $this->getRelocation();
				break;
			case 27:
				return $this->getYexperience();
				break;
			case 28:
				return $this->getCanworkas();
				break;
			case 29:
				return $this->getResumeurl();
				break;
			case 30:
				return $this->getExpequity();
				break;
			case 31:
				return $this->getReadycommitment();
				break;
			case 32:
				return $this->getAvatarId();
				break;
			case 33:
				return $this->getPasswordSha1();
				break;
			case 34:
				return $this->getSalt();
				break;
			case 35:
				return $this->getInvited();
				break;
			case 36:
				return $this->getCreatedAt();
				break;
			case 37:
				return $this->getUpdatedAt();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = UserPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getType(),
			$keys[2] => $this->getFirstName(),
			$keys[3] => $this->getLastName(),
			$keys[4] => $this->getEmail(),
			$keys[5] => $this->getNickname(),
			$keys[6] => $this->getNotifications(),
			$keys[7] => $this->getMsn(),
			$keys[8] => $this->getYahoo(),
			$keys[9] => $this->getIcq(),
			$keys[10] => $this->getSkype(),
			$keys[11] => $this->getGtalk(),
			$keys[12] => $this->getAim(),
			$keys[13] => $this->getTwitter(),
			$keys[14] => $this->getLocation(),
			$keys[15] => $this->getVentures(),
			$keys[16] => $this->getWebsite(),
			$keys[17] => $this->getRaisedmoney(),
			$keys[18] => $this->getVentureraised(),
			$keys[19] => $this->getLinkedin(),
			$keys[20] => $this->getFacebook(),
			$keys[21] => $this->getAvatarurl(),
			$keys[22] => $this->getZipcode(),
			$keys[23] => $this->getCountry(),
			$keys[24] => $this->getState(),
			$keys[25] => $this->getAge(),
			$keys[26] => $this->getRelocation(),
			$keys[27] => $this->getYexperience(),
			$keys[28] => $this->getCanworkas(),
			$keys[29] => $this->getResumeurl(),
			$keys[30] => $this->getExpequity(),
			$keys[31] => $this->getReadycommitment(),
			$keys[32] => $this->getAvatarId(),
			$keys[33] => $this->getPasswordSha1(),
			$keys[34] => $this->getSalt(),
			$keys[35] => $this->getInvited(),
			$keys[36] => $this->getCreatedAt(),
			$keys[37] => $this->getUpdatedAt(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = UserPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setType($value);
				break;
			case 2:
				$this->setFirstName($value);
				break;
			case 3:
				$this->setLastName($value);
				break;
			case 4:
				$this->setEmail($value);
				break;
			case 5:
				$this->setNickname($value);
				break;
			case 6:
				$this->setNotifications($value);
				break;
			case 7:
				$this->setMsn($value);
				break;
			case 8:
				$this->setYahoo($value);
				break;
			case 9:
				$this->setIcq($value);
				break;
			case 10:
				$this->setSkype($value);
				break;
			case 11:
				$this->setGtalk($value);
				break;
			case 12:
				$this->setAim($value);
				break;
			case 13:
				$this->setTwitter($value);
				break;
			case 14:
				$this->setLocation($value);
				break;
			case 15:
				$this->setVentures($value);
				break;
			case 16:
				$this->setWebsite($value);
				break;
			case 17:
				$this->setRaisedmoney($value);
				break;
			case 18:
				$this->setVentureraised($value);
				break;
			case 19:
				$this->setLinkedin($value);
				break;
			case 20:
				$this->setFacebook($value);
				break;
			case 21:
				$this->setAvatarurl($value);
				break;
			case 22:
				$this->setZipcode($value);
				break;
			case 23:
				$this->setCountry($value);
				break;
			case 24:
				$this->setState($value);
				break;
			case 25:
				$this->setAge($value);
				break;
			case 26:
				$this->setRelocation($value);
				break;
			case 27:
				$this->setYexperience($value);
				break;
			case 28:
				$this->setCanworkas($value);
				break;
			case 29:
				$this->setResumeurl($value);
				break;
			case 30:
				$this->setExpequity($value);
				break;
			case 31:
				$this->setReadycommitment($value);
				break;
			case 32:
				$this->setAvatarId($value);
				break;
			case 33:
				$this->setPasswordSha1($value);
				break;
			case 34:
				$this->setSalt($value);
				break;
			case 35:
				$this->setInvited($value);
				break;
			case 36:
				$this->setCreatedAt($value);
				break;
			case 37:
				$this->setUpdatedAt($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = UserPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setType($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setFirstName($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setLastName($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setEmail($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setNickname($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setNotifications($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setMsn($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setYahoo($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setIcq($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setSkype($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setGtalk($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setAim($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setTwitter($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setLocation($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setVentures($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setWebsite($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setRaisedmoney($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setVentureraised($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setLinkedin($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setFacebook($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setAvatarurl($arr[$keys[21]]);
		if (array_key_exists($keys[22], $arr)) $this->setZipcode($arr[$keys[22]]);
		if (array_key_exists($keys[23], $arr)) $this->setCountry($arr[$keys[23]]);
		if (array_key_exists($keys[24], $arr)) $this->setState($arr[$keys[24]]);
		if (array_key_exists($keys[25], $arr)) $this->setAge($arr[$keys[25]]);
		if (array_key_exists($keys[26], $arr)) $this->setRelocation($arr[$keys[26]]);
		if (array_key_exists($keys[27], $arr)) $this->setYexperience($arr[$keys[27]]);
		if (array_key_exists($keys[28], $arr)) $this->setCanworkas($arr[$keys[28]]);
		if (array_key_exists($keys[29], $arr)) $this->setResumeurl($arr[$keys[29]]);
		if (array_key_exists($keys[30], $arr)) $this->setExpequity($arr[$keys[30]]);
		if (array_key_exists($keys[31], $arr)) $this->setReadycommitment($arr[$keys[31]]);
		if (array_key_exists($keys[32], $arr)) $this->setAvatarId($arr[$keys[32]]);
		if (array_key_exists($keys[33], $arr)) $this->setPasswordSha1($arr[$keys[33]]);
		if (array_key_exists($keys[34], $arr)) $this->setSalt($arr[$keys[34]]);
		if (array_key_exists($keys[35], $arr)) $this->setInvited($arr[$keys[35]]);
		if (array_key_exists($keys[36], $arr)) $this->setCreatedAt($arr[$keys[36]]);
		if (array_key_exists($keys[37], $arr)) $this->setUpdatedAt($arr[$keys[37]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(UserPeer::DATABASE_NAME);

		if ($this->isColumnModified(UserPeer::ID)) $criteria->add(UserPeer::ID, $this->id);
		if ($this->isColumnModified(UserPeer::TYPE)) $criteria->add(UserPeer::TYPE, $this->type);
		if ($this->isColumnModified(UserPeer::FIRST_NAME)) $criteria->add(UserPeer::FIRST_NAME, $this->first_name);
		if ($this->isColumnModified(UserPeer::LAST_NAME)) $criteria->add(UserPeer::LAST_NAME, $this->last_name);
		if ($this->isColumnModified(UserPeer::EMAIL)) $criteria->add(UserPeer::EMAIL, $this->email);
		if ($this->isColumnModified(UserPeer::NICKNAME)) $criteria->add(UserPeer::NICKNAME, $this->nickname);
		if ($this->isColumnModified(UserPeer::NOTIFICATIONS)) $criteria->add(UserPeer::NOTIFICATIONS, $this->notifications);
		if ($this->isColumnModified(UserPeer::MSN)) $criteria->add(UserPeer::MSN, $this->msn);
		if ($this->isColumnModified(UserPeer::YAHOO)) $criteria->add(UserPeer::YAHOO, $this->yahoo);
		if ($this->isColumnModified(UserPeer::ICQ)) $criteria->add(UserPeer::ICQ, $this->icq);
		if ($this->isColumnModified(UserPeer::SKYPE)) $criteria->add(UserPeer::SKYPE, $this->skype);
		if ($this->isColumnModified(UserPeer::GTALK)) $criteria->add(UserPeer::GTALK, $this->gtalk);
		if ($this->isColumnModified(UserPeer::AIM)) $criteria->add(UserPeer::AIM, $this->aim);
		if ($this->isColumnModified(UserPeer::TWITTER)) $criteria->add(UserPeer::TWITTER, $this->twitter);
		if ($this->isColumnModified(UserPeer::LOCATION)) $criteria->add(UserPeer::LOCATION, $this->location);
		if ($this->isColumnModified(UserPeer::VENTURES)) $criteria->add(UserPeer::VENTURES, $this->ventures);
		if ($this->isColumnModified(UserPeer::WEBSITE)) $criteria->add(UserPeer::WEBSITE, $this->website);
		if ($this->isColumnModified(UserPeer::RAISEDMONEY)) $criteria->add(UserPeer::RAISEDMONEY, $this->raisedmoney);
		if ($this->isColumnModified(UserPeer::VENTURERAISED)) $criteria->add(UserPeer::VENTURERAISED, $this->ventureraised);
		if ($this->isColumnModified(UserPeer::LINKEDIN)) $criteria->add(UserPeer::LINKEDIN, $this->linkedin);
		if ($this->isColumnModified(UserPeer::FACEBOOK)) $criteria->add(UserPeer::FACEBOOK, $this->facebook);
		if ($this->isColumnModified(UserPeer::AVATARURL)) $criteria->add(UserPeer::AVATARURL, $this->avatarurl);
		if ($this->isColumnModified(UserPeer::ZIPCODE)) $criteria->add(UserPeer::ZIPCODE, $this->zipcode);
		if ($this->isColumnModified(UserPeer::COUNTRY)) $criteria->add(UserPeer::COUNTRY, $this->country);
		if ($this->isColumnModified(UserPeer::STATE)) $criteria->add(UserPeer::STATE, $this->state);
		if ($this->isColumnModified(UserPeer::AGE)) $criteria->add(UserPeer::AGE, $this->age);
		if ($this->isColumnModified(UserPeer::RELOCATION)) $criteria->add(UserPeer::RELOCATION, $this->relocation);
		if ($this->isColumnModified(UserPeer::YEXPERIENCE)) $criteria->add(UserPeer::YEXPERIENCE, $this->yexperience);
		if ($this->isColumnModified(UserPeer::CANWORKAS)) $criteria->add(UserPeer::CANWORKAS, $this->canworkas);
		if ($this->isColumnModified(UserPeer::RESUMEURL)) $criteria->add(UserPeer::RESUMEURL, $this->resumeurl);
		if ($this->isColumnModified(UserPeer::EXPEQUITY)) $criteria->add(UserPeer::EXPEQUITY, $this->expequity);
		if ($this->isColumnModified(UserPeer::READYCOMMITMENT)) $criteria->add(UserPeer::READYCOMMITMENT, $this->readycommitment);
		if ($this->isColumnModified(UserPeer::AVATAR_ID)) $criteria->add(UserPeer::AVATAR_ID, $this->avatar_id);
		if ($this->isColumnModified(UserPeer::PASSWORD_SHA1)) $criteria->add(UserPeer::PASSWORD_SHA1, $this->password_sha1);
		if ($this->isColumnModified(UserPeer::SALT)) $criteria->add(UserPeer::SALT, $this->salt);
		if ($this->isColumnModified(UserPeer::INVITED)) $criteria->add(UserPeer::INVITED, $this->invited);
		if ($this->isColumnModified(UserPeer::CREATED_AT)) $criteria->add(UserPeer::CREATED_AT, $this->created_at);
		if ($this->isColumnModified(UserPeer::UPDATED_AT)) $criteria->add(UserPeer::UPDATED_AT, $this->updated_at);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(UserPeer::DATABASE_NAME);

		$criteria->add(UserPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setType($this->type);

		$copyObj->setFirstName($this->first_name);

		$copyObj->setLastName($this->last_name);

		$copyObj->setEmail($this->email);

		$copyObj->setNickname($this->nickname);

		$copyObj->setNotifications($this->notifications);

		$copyObj->setMsn($this->msn);

		$copyObj->setYahoo($this->yahoo);

		$copyObj->setIcq($this->icq);

		$copyObj->setSkype($this->skype);

		$copyObj->setGtalk($this->gtalk);

		$copyObj->setAim($this->aim);

		$copyObj->setTwitter($this->twitter);

		$copyObj->setLocation($this->location);

		$copyObj->setVentures($this->ventures);

		$copyObj->setWebsite($this->website);

		$copyObj->setRaisedmoney($this->raisedmoney);

		$copyObj->setVentureraised($this->ventureraised);

		$copyObj->setLinkedin($this->linkedin);

		$copyObj->setFacebook($this->facebook);

		$copyObj->setAvatarurl($this->avatarurl);

		$copyObj->setZipcode($this->zipcode);

		$copyObj->setCountry($this->country);

		$copyObj->setState($this->state);

		$copyObj->setAge($this->age);

		$copyObj->setRelocation($this->relocation);

		$copyObj->setYexperience($this->yexperience);

		$copyObj->setCanworkas($this->canworkas);

		$copyObj->setResumeurl($this->resumeurl);

		$copyObj->setExpequity($this->expequity);

		$copyObj->setReadycommitment($this->readycommitment);

		$copyObj->setAvatarId($this->avatar_id);

		$copyObj->setPasswordSha1($this->password_sha1);

		$copyObj->setSalt($this->salt);

		$copyObj->setInvited($this->invited);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setUpdatedAt($this->updated_at);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getCompanyShadows() as $relObj) {
				$copyObj->addCompanyShadow($relObj->copy($deepCopy));
			}

			foreach($this->getCompanys() as $relObj) {
				$copyObj->addCompany($relObj->copy($deepCopy));
			}

			foreach($this->getUser2Permissions() as $relObj) {
				$copyObj->addUser2Permission($relObj->copy($deepCopy));
			}

			foreach($this->getCompanyCommentss() as $relObj) {
				$copyObj->addCompanyComments($relObj->copy($deepCopy));
			}

			foreach($this->getPostss() as $relObj) {
				$copyObj->addPosts($relObj->copy($deepCopy));
			}

			foreach($this->getCommentss() as $relObj) {
				$copyObj->addComments($relObj->copy($deepCopy));
			}

			foreach($this->getuser2facebooks() as $relObj) {
				$copyObj->adduser2facebook($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new UserPeer();
		}
		return self::$peer;
	}

	
	public function initCompanyShadows()
	{
		if ($this->collCompanyShadows === null) {
			$this->collCompanyShadows = array();
		}
	}

	
	public function getCompanyShadows($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyShadowPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanyShadows === null) {
			if ($this->isNew()) {
			   $this->collCompanyShadows = array();
			} else {

				$criteria->add(CompanyShadowPeer::AUTHOR_ID, $this->getId());

				CompanyShadowPeer::addSelectColumns($criteria);
				$this->collCompanyShadows = CompanyShadowPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CompanyShadowPeer::AUTHOR_ID, $this->getId());

				CompanyShadowPeer::addSelectColumns($criteria);
				if (!isset($this->lastCompanyShadowCriteria) || !$this->lastCompanyShadowCriteria->equals($criteria)) {
					$this->collCompanyShadows = CompanyShadowPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCompanyShadowCriteria = $criteria;
		return $this->collCompanyShadows;
	}

	
	public function countCompanyShadows($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyShadowPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CompanyShadowPeer::AUTHOR_ID, $this->getId());

		return CompanyShadowPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCompanyShadow(CompanyShadow $l)
	{
		$this->collCompanyShadows[] = $l;
		$l->setUser($this);
	}


	
	public function getCompanyShadowsJoinCompany($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyShadowPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanyShadows === null) {
			if ($this->isNew()) {
				$this->collCompanyShadows = array();
			} else {

				$criteria->add(CompanyShadowPeer::AUTHOR_ID, $this->getId());

				$this->collCompanyShadows = CompanyShadowPeer::doSelectJoinCompany($criteria, $con);
			}
		} else {
									
			$criteria->add(CompanyShadowPeer::AUTHOR_ID, $this->getId());

			if (!isset($this->lastCompanyShadowCriteria) || !$this->lastCompanyShadowCriteria->equals($criteria)) {
				$this->collCompanyShadows = CompanyShadowPeer::doSelectJoinCompany($criteria, $con);
			}
		}
		$this->lastCompanyShadowCriteria = $criteria;

		return $this->collCompanyShadows;
	}

	
	public function initCompanys()
	{
		if ($this->collCompanys === null) {
			$this->collCompanys = array();
		}
	}

	
	public function getCompanys($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanys === null) {
			if ($this->isNew()) {
			   $this->collCompanys = array();
			} else {

				$criteria->add(CompanyPeer::AUTHOR_ID, $this->getId());

				CompanyPeer::addSelectColumns($criteria);
				$this->collCompanys = CompanyPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CompanyPeer::AUTHOR_ID, $this->getId());

				CompanyPeer::addSelectColumns($criteria);
				if (!isset($this->lastCompanyCriteria) || !$this->lastCompanyCriteria->equals($criteria)) {
					$this->collCompanys = CompanyPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCompanyCriteria = $criteria;
		return $this->collCompanys;
	}

	
	public function countCompanys($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CompanyPeer::AUTHOR_ID, $this->getId());

		return CompanyPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCompany(Company $l)
	{
		$this->collCompanys[] = $l;
		$l->setUser($this);
	}


	
	public function getCompanysJoinCompanyShadow($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanys === null) {
			if ($this->isNew()) {
				$this->collCompanys = array();
			} else {

				$criteria->add(CompanyPeer::AUTHOR_ID, $this->getId());

				$this->collCompanys = CompanyPeer::doSelectJoinCompanyShadow($criteria, $con);
			}
		} else {
									
			$criteria->add(CompanyPeer::AUTHOR_ID, $this->getId());

			if (!isset($this->lastCompanyCriteria) || !$this->lastCompanyCriteria->equals($criteria)) {
				$this->collCompanys = CompanyPeer::doSelectJoinCompanyShadow($criteria, $con);
			}
		}
		$this->lastCompanyCriteria = $criteria;

		return $this->collCompanys;
	}

	
	public function initUser2Permissions()
	{
		if ($this->collUser2Permissions === null) {
			$this->collUser2Permissions = array();
		}
	}

	
	public function getUser2Permissions($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUser2PermissionPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUser2Permissions === null) {
			if ($this->isNew()) {
			   $this->collUser2Permissions = array();
			} else {

				$criteria->add(User2PermissionPeer::USER_ID, $this->getId());

				User2PermissionPeer::addSelectColumns($criteria);
				$this->collUser2Permissions = User2PermissionPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(User2PermissionPeer::USER_ID, $this->getId());

				User2PermissionPeer::addSelectColumns($criteria);
				if (!isset($this->lastUser2PermissionCriteria) || !$this->lastUser2PermissionCriteria->equals($criteria)) {
					$this->collUser2Permissions = User2PermissionPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUser2PermissionCriteria = $criteria;
		return $this->collUser2Permissions;
	}

	
	public function countUser2Permissions($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUser2PermissionPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(User2PermissionPeer::USER_ID, $this->getId());

		return User2PermissionPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUser2Permission(User2Permission $l)
	{
		$this->collUser2Permissions[] = $l;
		$l->setUser($this);
	}

	
	public function initCompanyCommentss()
	{
		if ($this->collCompanyCommentss === null) {
			$this->collCompanyCommentss = array();
		}
	}

	
	public function getCompanyCommentss($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanyCommentss === null) {
			if ($this->isNew()) {
			   $this->collCompanyCommentss = array();
			} else {

				$criteria->add(CompanyCommentsPeer::AUTHOR_ID, $this->getId());

				CompanyCommentsPeer::addSelectColumns($criteria);
				$this->collCompanyCommentss = CompanyCommentsPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CompanyCommentsPeer::AUTHOR_ID, $this->getId());

				CompanyCommentsPeer::addSelectColumns($criteria);
				if (!isset($this->lastCompanyCommentsCriteria) || !$this->lastCompanyCommentsCriteria->equals($criteria)) {
					$this->collCompanyCommentss = CompanyCommentsPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCompanyCommentsCriteria = $criteria;
		return $this->collCompanyCommentss;
	}

	
	public function countCompanyCommentss($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CompanyCommentsPeer::AUTHOR_ID, $this->getId());

		return CompanyCommentsPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCompanyComments(CompanyComments $l)
	{
		$this->collCompanyCommentss[] = $l;
		$l->setUser($this);
	}


	
	public function getCompanyCommentssJoinCompany($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCompanyCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCompanyCommentss === null) {
			if ($this->isNew()) {
				$this->collCompanyCommentss = array();
			} else {

				$criteria->add(CompanyCommentsPeer::AUTHOR_ID, $this->getId());

				$this->collCompanyCommentss = CompanyCommentsPeer::doSelectJoinCompany($criteria, $con);
			}
		} else {
									
			$criteria->add(CompanyCommentsPeer::AUTHOR_ID, $this->getId());

			if (!isset($this->lastCompanyCommentsCriteria) || !$this->lastCompanyCommentsCriteria->equals($criteria)) {
				$this->collCompanyCommentss = CompanyCommentsPeer::doSelectJoinCompany($criteria, $con);
			}
		}
		$this->lastCompanyCommentsCriteria = $criteria;

		return $this->collCompanyCommentss;
	}

	
	public function initPostss()
	{
		if ($this->collPostss === null) {
			$this->collPostss = array();
		}
	}

	
	public function getPostss($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePostsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPostss === null) {
			if ($this->isNew()) {
			   $this->collPostss = array();
			} else {

				$criteria->add(PostsPeer::AUTHOR_ID, $this->getId());

				PostsPeer::addSelectColumns($criteria);
				$this->collPostss = PostsPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(PostsPeer::AUTHOR_ID, $this->getId());

				PostsPeer::addSelectColumns($criteria);
				if (!isset($this->lastPostsCriteria) || !$this->lastPostsCriteria->equals($criteria)) {
					$this->collPostss = PostsPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastPostsCriteria = $criteria;
		return $this->collPostss;
	}

	
	public function countPostss($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BasePostsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(PostsPeer::AUTHOR_ID, $this->getId());

		return PostsPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addPosts(Posts $l)
	{
		$this->collPostss[] = $l;
		$l->setUser($this);
	}

	
	public function initCommentss()
	{
		if ($this->collCommentss === null) {
			$this->collCommentss = array();
		}
	}

	
	public function getCommentss($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCommentss === null) {
			if ($this->isNew()) {
			   $this->collCommentss = array();
			} else {

				$criteria->add(CommentsPeer::AUTHOR_ID, $this->getId());

				CommentsPeer::addSelectColumns($criteria);
				$this->collCommentss = CommentsPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CommentsPeer::AUTHOR_ID, $this->getId());

				CommentsPeer::addSelectColumns($criteria);
				if (!isset($this->lastCommentsCriteria) || !$this->lastCommentsCriteria->equals($criteria)) {
					$this->collCommentss = CommentsPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCommentsCriteria = $criteria;
		return $this->collCommentss;
	}

	
	public function countCommentss($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CommentsPeer::AUTHOR_ID, $this->getId());

		return CommentsPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addComments(Comments $l)
	{
		$this->collCommentss[] = $l;
		$l->setUser($this);
	}


	
	public function getCommentssJoinPosts($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCommentsPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCommentss === null) {
			if ($this->isNew()) {
				$this->collCommentss = array();
			} else {

				$criteria->add(CommentsPeer::AUTHOR_ID, $this->getId());

				$this->collCommentss = CommentsPeer::doSelectJoinPosts($criteria, $con);
			}
		} else {
									
			$criteria->add(CommentsPeer::AUTHOR_ID, $this->getId());

			if (!isset($this->lastCommentsCriteria) || !$this->lastCommentsCriteria->equals($criteria)) {
				$this->collCommentss = CommentsPeer::doSelectJoinPosts($criteria, $con);
			}
		}
		$this->lastCommentsCriteria = $criteria;

		return $this->collCommentss;
	}

	
	public function inituser2facebooks()
	{
		if ($this->colluser2facebooks === null) {
			$this->colluser2facebooks = array();
		}
	}

	
	public function getuser2facebooks($criteria = null, $con = null)
	{
				include_once 'lib/model/om/Baseuser2facebookPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->colluser2facebooks === null) {
			if ($this->isNew()) {
			   $this->colluser2facebooks = array();
			} else {

				$criteria->add(user2facebookPeer::USER_ID, $this->getId());

				user2facebookPeer::addSelectColumns($criteria);
				$this->colluser2facebooks = user2facebookPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(user2facebookPeer::USER_ID, $this->getId());

				user2facebookPeer::addSelectColumns($criteria);
				if (!isset($this->lastuser2facebookCriteria) || !$this->lastuser2facebookCriteria->equals($criteria)) {
					$this->colluser2facebooks = user2facebookPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastuser2facebookCriteria = $criteria;
		return $this->colluser2facebooks;
	}

	
	public function countuser2facebooks($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/Baseuser2facebookPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(user2facebookPeer::USER_ID, $this->getId());

		return user2facebookPeer::doCount($criteria, $distinct, $con);
	}

	
	public function adduser2facebook(user2facebook $l)
	{
		$this->colluser2facebooks[] = $l;
		$l->setUser($this);
	}

} 